package com.hejing.project03_优尚开发团队人员调度系统.junit;

import com.hejing.project03_优尚开发团队人员调度系统.domain.Employee;
import com.hejing.project03_优尚开发团队人员调度系统.service.NameListService;
import com.hejing.project03_优尚开发团队人员调度系统.service.TeamException;
import org.junit.Test;

/**
 * ClassName: NameListServiceTest
 * Package: com.hejing.project03_优尚开发团队人员调度系统.junit
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-04-13 20:21
 * @Version: 1.0
 */
public class NameListServiceTest {
    @Test
    public void testGetAllEmployees(){
        NameListService nameList = new NameListService();
        Employee[] employees = nameList.getAllEmployees();
        for(int i = 0; i < employees.length; i++){
            System.out.println(employees[i]);
        }
    }

    @Test
    public void testGetEmployee(){
        int id = 300;
        NameListService nameList = new NameListService();
        try{
            Employee employee = nameList.getEmployee(id);
            System.out.println(employee);
        } catch(TeamException e) {
            System.out.println(e.getMessage());;
        }

    }
}

























